//
//  CameraView.h
//  test2
//
//  Created by 柳麟喆 on 2018/2/27.
//  Copyright © 2018年 lzLiu. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "VideoPreview.h"

@class CameraView;
@protocol CameraViewDelegate <NSObject>
@optional;

/// 转换摄像头
-(void)swicthCameraAction:(CameraView *)cameraView succ:(void(^)(void))succ fail:(void(^)(NSError *error))fail;
/// 闪光灯
-(void)flashLightAction:(CameraView *)cameraView succ:(void(^)(void))succ fail:(void(^)(NSError *error))fail;
/// 补光
-(void)torchLightAction:(CameraView *)cameraView succ:(void(^)(void))succ fail:(void(^)(NSError *error))fail;
/// 聚焦
-(void)focusAction:(CameraView *)cameraView point:(CGPoint)point succ:(void(^)(void))succ fail:(void(^)(NSError *error))fail;
/// 曝光
-(void)exposAction:(CameraView *)cameraView point:(CGPoint)point succ:(void(^)(void))succ fail:(void(^)(NSError *error))fail;
/// 自动聚焦曝光
-(void)autoFocusAndExposureAction:(CameraView *)cameraView succ:(void(^)(void))succ fail:(void(^)(NSError *error))fail;

/// 取消
-(void)cancelAction:(CameraView *)cameraView;
/// 拍照
-(void)takePhotoAction:(CameraView *)cameraView;
/// 停止录制视频
-(void)stopRecordVideoAction:(CameraView *)cameraView;
/// 开始录制视频
-(void)startRecordVideoAction:(CameraView *)cameraView;
/// 改变拍摄类型
-(void)didChangeTypeAction:(CameraView *)cameraView type:(NSInteger)type;

@end

@interface CameraView : UIView

@property(nonatomic, weak) id <CameraViewDelegate> delegate;

@property(nonatomic, strong, readonly) VideoPreview *previewView;

@property(nonatomic, assign, readonly) NSInteger type; // 1：拍照 2：视频

-(void)changeTorch:(BOOL)on;

-(void)changeFlash:(BOOL)on;

@end
